package com.tee.converter;

import java.util.Map;

import com.tee.bean.privilege.SystemPrivilegePK;


import ognl.DefaultTypeConverter;

public class SystemPrivilegePKConverter extends  DefaultTypeConverter {

	@Override
	public Object convertValue(Map context, Object value, Class toType) {
		if (SystemPrivilegePK.class == toType) {   
            String param =(String) value;
			String[] arr = param.split(",");
			if(arr.length==2){
				return new SystemPrivilegePK(arr[0], arr[1]);
			}
        } else if (String.class == toType) {   
            return value.toString();   
        }   
        return super.convertValue(context, value, toType);   
	}


}
